import { defineStore } from "pinia";
import type { ChatMessage } from "../types/chat";

export const useChatStore = defineStore("chat", {
  state: () => ({
    messageHistory: [] as ChatMessage[],
  }),

  actions: {
    addMessage(message: ChatMessage) {
      this.messageHistory.push(message);
    },

    clearHistory() {
      this.messageHistory = [];
    },
  },
});
